package com.summer.aop;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class DynamicProxyObj {
	Object target = null;
	
	public DynamicProxyObj(Object target){
		this.target = target;
	}
	
	public Object invoke(Method method,Object... args) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
		return method.invoke(target, args);
	}
	
	public static void main(String[] args) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
		TestObj target = new TestObj();
		target.todo1();
		
		DynamicProxyObj dynamicProxyObj = new DynamicProxyObj(target);
		dynamicProxyObj.invoke(TestObj.class.getDeclaredMethod("todo1"));
	}
	
}
